package com.isoft.service;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.isoft.IService.ISysUserService;
import com.isoft.dao.SysUserDao;
import com.isoft.domain.SysUser;
/**
 * 
 * @Author yigeyanse@hotmail.com
 * @Date 2017年9月6日 上午10:11:04
 */
@Service
public class SysUserService implements ISysUserService{

	@Autowired
	private SysUserDao sysUserDao;

	@Override
	@Transactional
	public void insertTwo() {
		SysUser g1 = new SysUser();
		g1.setSysUserAge(22);
		g1.setSysUserName("peter");
		g1.setSysUserPwd("123123");
		sysUserDao.save(g1);
		
		SysUser g2 = new SysUser();
		g2.setSysUserAge(25);
		g2.setSysUserName("jelly");
		g2.setSysUserPwd("111111");
		sysUserDao.save(g2);
	}

	@Override
	public SysUser findBySysUserId(Integer id) {	
		return sysUserDao.findBySysUserId(id);
	}

	@Override
	public SysUser findByUserName(String userName) {
		return sysUserDao.findBySysUserName(userName);
	}

	@Override
	public void insertOne(SysUser user) {
		
		sysUserDao.save(user);
		
	}

}
